import java.util.Scanner;

public class HomeWork12_04{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        
        int[] arr = new int[10];
        for(int i = 0; i < arr.length; i++){
            arr[i] = i;
        }
        
        System.out.print("please enter an itger:");
        int itger = scan.nextInt();
        
        arr = ArrOprt.insertIntArr(arr, itger);
        
        for(int item : arr){
            System.out.println(item);
        }
    }
}

class ArrOprt{
    public static int[] insertIntArr(int[] arr, int itger){
        int[] arr2 = new int[arr.length + 1];
        
        int j = 0;
        boolean tag = false;
        for(int i = 0; i < arr2.length; i++){
            if(j >= arr.length || tag == false && itger < arr[j]){
                arr2[i] = itger;
                tag = true;
            }else{
                arr2[i] = arr[j];
                j++;
            }
        }
        
        return arr2;
    }
}